/**
 * qiankun调试脚本
 * 帮助诊断微前端加载问题
 */
(function () {
  console.log('=== qiankun调试信息 ===');

  // 检查qiankun标识
  console.log('window.__POWERED_BY_QIANKUN__:', window.__POWERED_BY_QIANKUN__);

  // 检查生命周期函数
  console.log('window.bootstrap:', typeof window.bootstrap);
  console.log('window.mount:', typeof window.mount);
  console.log('window.unmount:', typeof window.unmount);

  // 检查容器
  const containers = ['#micro-container', '#dashboard-app-app', '#dashboard-app'];

  containers.forEach((selector) => {
    const element = document.querySelector(selector);
    console.log(`容器 ${selector}:`, element ? '存在' : '不存在');
    if (element) {
      console.log(`  - innerHTML长度: ${element.innerHTML.length}`);
      console.log(`  - 子元素数量: ${element.children.length}`);
    }
  });

  // 检查Vue应用实例
  setTimeout(() => {
    const app = document.querySelector('#dashboard-app');
    if (app) {
      console.log('Vue应用容器找到:', app);
      console.log('Vue应用内容:', `${app.innerHTML.substring(0, 200)}...`);
    } else {
      console.log('Vue应用容器未找到');
    }
  }, 2000);

  console.log('=== 调试信息结束 ===');
})();
